Add option to keep original tab open on container switch#17
Add option to keep original tab open on container switch#17tomludd wants to merge 2 commits intoicholy:masterfrom
Conversation
…I checkbox and storage handling
|
What if we added Lines 21 to 25 in 4c1d003 Then you could chose the behaviour per-container: if (url.hostname === "www.google.ca") {
return {
name: "Search",
replace: false,
}
} |
|
I struggle to see how this would help. As this would make the feature close my google search tab depending on what container the clicked link was opened in. May be a rule list for what domains to keep open? |
|
Hmm ok, seems like I'm not grasping your use-case. Can you walk me through a realistic step by step scenario? |
|
Will do! So mostly this is a problem that happens when I navigate back and forth between websites, searching mostly. Many answers are found on reddit, so I click that link. Now, Reddit is connected to my personal container while Google is not. When reddit is opened in a new container tab the history is lost. The result is I can no longer navigate back to the search I came from. Reopening recently closed tab is the only way of getting back to the previous page. Now the best solution would be to rewrite the histroy for the tab but that seems impossible at the moment. So keeping the tab open in some cases seems like the second best solution. I've updated the code now with |
Hey! I really like your extension, and I found one thing I wanted to improve on:
When ContainerScript redirects a URL into a different container, the original tab is always closed. This can be disruptive when the user is navigating from an existing page — they lose that page's context and history. However, if the user just opened a fresh new tab (e.g. about:newtab), closing it is the expected behavior.
Solution
This PR adds a "Keep original tab open on container switch" checkbox to the editor UI. When enabled, the original tab is preserved after the new container tab is created. Blank/new tabs (about:newtab, about:blank, about:home) are always closed regardless of the setting, since keeping an empty tab around serves no purpose.
Now when I do a google search and click a link the google search tab will no longer close, but a new tab is opened with correct container.